<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>AngularJs的路由练习</title>
		<script type="text/javascript" src="../js/angular.min.js"></script>
		<script type="text/javascript" src="../js/angular-route.min.js"></script>
	</head>
	<body ng-app="myapp">
		<div>
			<h1>HEAD</h1>
			<a href="#/JavaEE">javaEE</a>
			<a href="#/Ios">Ios</a>
			<a href="#/Android">Android</a>
		</div>
		<!-- 路由加载后,更新变化的内容 -->
		<div ng-view>
			
		</div>
		<div>
			<h1>FOOT</h1>
		</div>
	</body>
	
	<script type="text/javascript">
		// 定义myapp 模块
		var myapp = angular.module("myapp",["ngRoute"]);
		// 配置模块的路由
		myapp.config(["$routeProvider",function($routeProvider){
			$routeProvider
			.when('/JavaEE',{
				templateUrl : '4_1.html'
			}).when('/Ios',{
				templateUrl : '4_2.html'
			}).when('/Android',{
				templateUrl : '4_3.html'
			}).otherwise({
				redirectTo : '/JavaEE'
			});
		}]);
	</script>
</html>
